package com.coolgor.airvow.Util;

import java.io.*;
import java.util.Calendar;

public class PubFunc 
{	
	public static String read(){
		try {
			InputStreamReader inStream = new InputStreamReader(System.in);
		    BufferedReader br = new BufferedReader(inStream);   
		    return br.readLine();  
		} catch (IOException ioe){
			System.out.println(" ReadLine Error !");
			return null;
		}		
	}

	public static String leach_null(String s)
	{	
		if (null == s) return "";
		if ("null".equals(s.toLowerCase())) return "";
		return s;
	}
	
	public static String FormatNumberString(String string)
	{	
		String str = string;
		if ( null == str ) return "";
		str=str.toLowerCase();
		if ("null".equals(str)) return "";
		
		return str;
	}
	
	public static String FormatDataString(String data, String inFormat, String outFormat){
		String y ;
		String m ;
		String d ;
		String result = null;
		if ("yyyymmdd".equals(inFormat)){
			
		}
		else if ("yyyy.mm.dd".equals(inFormat)){
			
		}
		else if ("yyyy年mm月dd日".equals(inFormat)) {
			
		}
		else if ("yyyy-mm-dd".equals(inFormat)) {
			
		}
		else if ("yyyy/mm/dd".equals(inFormat)) {
			
		}
		else result = null;
		return result;
	}


	//获取当前时间的标准格式字符串，精确到毫秒。
	public static String getNowTime(){
		StringBuffer time = new StringBuffer();
		Calendar ca = Calendar.getInstance();
		//年
		time.append(ca.get(Calendar.YEAR));
		//月
		if ((ca.get(Calendar.MONTH)+1)<10) {
			time.append(0);
			time.append(ca.get(Calendar.MONTH)+1);
		}else{
			time.append(ca.get(Calendar.MONTH)+1);
		}
		//日
		if (ca.get(Calendar.DATE)<10) {
			time.append(0);
			time.append(ca.get(Calendar.DATE));
		}else{
			time.append(ca.get(Calendar.DATE));
		}
		//时
		if (ca.get(Calendar.HOUR_OF_DAY)<10) {
			time.append(0);
			time.append(ca.get(Calendar.HOUR_OF_DAY));
		}else{
			time.append(ca.get(Calendar.HOUR_OF_DAY));
		}		
		//分
		if (ca.get(Calendar.MINUTE)<10) {
			time.append(0);
			time.append(ca.get(Calendar.MINUTE));
		}else{
			time.append(ca.get(Calendar.MINUTE));
		}
		//秒
		if (ca.get(Calendar.SECOND)<10) {
			time.append(0);
			time.append(ca.get(Calendar.SECOND));
		}else{
			time.append(ca.get(Calendar.SECOND));
		}
		//毫秒
		time.append(ca.get(Calendar.MILLISECOND));
		//返回值
		return time.toString();
	}


	/**
	  * 判断字符串是否是整数
	  */
	 public static boolean isInteger(String value) {
	  try {
	   Integer.parseInt(value);
	   return true;
	  } catch (NumberFormatException e) {
	   return false;
	  }
	 }

	 /**
	  * 判断字符串是否是浮点数
	  */
	 public static boolean isDouble(String value) {
	  try {
	   Double.parseDouble(value);
	   if (value.contains("."))
	    return true;
	   return false;
	  } catch (NumberFormatException e) {
	   return false;
	  }
	 }

	 /**
	  * 判断字符串是否是数字
	  */
	 public static boolean isNumber(String value) {
	  return isInteger(value) || isDouble(value);
	 }

	
	public static void main(String s[])
	{
		String string = "25eS";
		System.out.println(string);
		string = PubFunc.FormatNumberString(string);
		System.out.println(string);
	}
}
